package com.liwu.publish.platform.common.exception;

import lombok.Data;

/**
 * @Auther: liwu
 * @Date: 2019/5/14 14:52
 * @Description:
 */
@Data
public class PublishException extends RuntimeException{


    private int code;
    private String message;
    private boolean isTips;


    public PublishException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
        this.isTips = true;
    }

    public PublishException(int code, String message, boolean isTips) {
        super(message);
        this.code = code;
        this.message = message;
        this.isTips = isTips;
    }

    public PublishException(ErrorCode errorCode) {
        this.code = errorCode.getCode();
        this.message = errorCode.getMessage();
        this.isTips = true;
    }

    public PublishException(ErrorCode errorCode, boolean isTips) {
        this.code = errorCode.getCode();
        this.message = errorCode.getMessage();
        this.isTips = isTips;
    }

    public PublishException(Throwable cause) {
        super(cause);
    }

    public PublishException(String message) {
        super(message);
        this.message = message;
    }

}
